﻿@using Abp.Web.Mvc.Extensions
@using Microsoft.Owin.Security
@model Aceso.LOreal.Web.Models.Account.LoginFormViewModel
@section Styles
{
    @*@Html.IncludeStyle("~/Views/Account/Login.css")*@
    <!--hplus样式-->
    @Html.IncludeStyle("~/Scripts/hplus/css/bootstrap.min.css")
    @Html.IncludeStyle("~/Scripts/hplus/css/font-awesome.min93e3.css")
    @Html.IncludeStyle("~/Scripts/hplus/css/animate.min.css")
    @Html.IncludeStyle("~/Scripts/hplus/css/style.min.css")
}
@section Scripts
{
    @Html.IncludeScript("~/Views/Account/Login.js")
    <!--hplus js-->
    @Html.IncludeScript("~/Scripts/hplus/js/jquery.min63b9.js")
    @Html.IncludeScript("~/Scripts/hplus/js/bootstrap.min14ed.js")
}
<body class="gray-bg">
    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">O+</h1>

            </div>


            @*<form id="LoginForm" class="form-horizontal" action="@(Url.Action("Login", "Account"))?returnUrl=@(Model.ReturnUrl)" method="POST">*@
            <h3>@L("LogIn")</h3>
            @using (Html.BeginForm("Login", "Account", FormMethod.Post, new { @class = "m-t" }))
            {
                @*<legend>@L("LogIn")</legend>*@

            if (Model.IsMultiTenancyEnabled)
            {
                <div class="form-group">

                    <input type="text" class="form-control" id="TenancyName" placeholder="Tenancy name" required maxlength="@Aceso.LOreal.MultiTenancy.Tenant.MaxTenancyNameLength">
                    <span class="text-muted">@L("CanBeEmptyToLoginAsHost")</span>

                </div>
            }
            else
            {
                <input type="hidden" id="TenancyName" value="">
            }

            <div class="form-group">

                <input type="text" class="form-control" id="EmailAddressInput" placeholder="User name or email" required maxlength="@Aceso.LOreal.Users.User.MaxEmailAddressLength">

            </div>

            <div class="form-group">

                <input type="password" class="form-control" id="PasswordInput" placeholder="Password" required maxlength="@Aceso.LOreal.Users.User.MaxPlainPasswordLength">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" id="RememberMeInput">
                        <span class="ripple"></span>
                        <span class="check"></span> @L("RememberMe")
                    </label>
                </div>

            </div>

            <input id="ReturnUrlHash" type="hidden" name="returnUrlHash" />

            <div class="form-group">

                <button id="LoginButton" type="submit" class="btn btn-primary"><i class="fa fa-sign-in"></i> @L("LogIn")</button>
                <a class="btn btn-success" href="@Url.Action("Register")"><i class="fa fa-sign-in"></i> @L("Register")</a>

            </div>

            @*</form>*@
            }
            @{
                var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes().ToList();
            }

            @if (loginProviders.Count > 0)
            {
                <p>@L("OrLoginWith"):</p>


                using (Html.BeginForm("ExternalLogin", "Account", method: FormMethod.Post))
                {
                    @Html.AntiForgeryToken()

                    <input type="hidden" name="returnUrl" value="@ViewBag.ReturnUrl" />
                    <input type="hidden" name="provider" value="" />

                    foreach (var provider in loginProviders)
                    {
                        <a class="btn btn-default btn-sm social-login-link" title="@provider.AuthenticationType"
                           data-provider="@provider.AuthenticationType"
                           href="javascript:;">
                            <i class="fa fa-@(provider.AuthenticationType.ToLower())"></i> @provider.AuthenticationType
                        </a>
                    }
                }
            }
        </div>
    </div>
</body>

